import request from '@/utils/request'

/** ==================
 *      1. 配置管理相关
 * ===================
 */

/**
 * 获取发件人信息管理数据
*/
export const getSenderInfo = (params) => {
  return request({
    url: '/api/otms-admin/senderInformation/list',
    method: 'get',
    params
  })
}
/**
 * 添加发件人信息管理数据
*/
export const addOrEditSenderInfo = (data) => {
  return request({
    url: `/api/otms-admin/senderInformation/${data.id ? 'update' : 'add'}`,
    method: 'post',
    data
  })
}
/**
 * 删除发件人信息管理数据
*/
export const deleteSenderInfo = (id) => {
  return request({
    url: `/api/otms-admin/senderInformation/remove/${id}`,
    method: 'post'
  })
}
/**
 * 默认发件人信息管理
*/
export const defaultSenderInfo = (id) => {
  return request({
    url: `/api/otms-admin/senderInformation/setType/${id}`,
    method: 'put'
  })
}
/**
 * 获取清关人信息管理数据
*/
export const getClearanceInfo = (params) => {
  return request({
    url: '/api/otms-admin/customsClearanceInformation/list',
    method: 'get',
    params
  })
}
/**
 * 添加清关人信息管理数据
*/
export const addOrEditClearanceInfo = (data) => {
  return request({
    url: `/api/otms-admin/customsClearanceInformation/${data.id ? 'update' : 'add'}`,
    method: 'post',
    data
  })
}
/**
 * 删除清关人信息管理数据
*/
export const deleteClearanceInfo = (id) => {
  return request({
    url: `/api/otms-admin/customsClearanceInformation/remove/${id}`,
    method: 'post'
  })
}
/**
 * 获取商品信息管理数据
*/
export const getGoodsInfo = (params) => {
  return request({
    url: '/api/otms-admin/goods/list',
    method: 'get',
    params
  })
}
/**
 * 添加商品信息管理数据
*/
export const addOrEditGoodsInfo = (data) => {
  return request({
    url: `/api/otms-admin/goods/${data.id ? 'update' : 'add'}`,
    method: 'post',
    data
  })
}
/**
 * 删除商品信息管理数据
*/
export const deleteGoodsInfo = (id) => {
  return request({
    url: `/api/otms-admin/goods/remove/${id}`,
    method: 'post'
  })
}
/**
 * 获取用户信息数据
*/
export const getEnterpriseInfo = (params) => {
  return request({
    url: '/api/otms-admin/baseInfo/getEnterpriseInfo',
    method: 'get',
    params
  })
}
/**
 * 编辑用户信息数据
*/
export const updateEnterpriseInfo = (data) => {
  return request({
    url: '/api/otms-admin/baseInfo/updateEnterpriseInfo',
    method: 'post',
    data
  })
}
/**
 * 修改密码
*/
export const updatePassword = (data) => {
  return request({
    url: '/api/otms-admin/baseInfo/updatePasswordByOldPassward',
    method: 'post',
    data
  })
}
